# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=nield
pkgver=41.cd96f76
pkgrel=1
groups=('blackarch' 'blackarch-networking')
pkgdesc='A tool to receive notifications from kernel through netlink socket, and generate logs related to interfaces, neighbor cache(ARP,NDP), IP address(IPv4,IPv6), routing, FIB rules, traffic control.'
arch=('x86_64' 'aarch64')
url='http://nield.sourceforge.net/'
license=('GPL2')
makedepends=('git')
source=("git+https://github.com/t2mune/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  if [[ "$CARCH" == "x86_64" ]];
  then
    ./configure --prefix=/usr --sbindir=/usr/bin
  else
    ./configure --build=arm --prefix=/usr --sbindir=/usr/bin
  fi

  make
}

package() {
  cd $pkgname

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" INSTALL ChangeLog
  install -Dm 644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"

  make DESTDIR="$pkgdir" install
}

